package com.xbang.attendance.web.action.purchase.timerole;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;



import com.xbang.attendance.entity.timerole.TimeRole;
import com.xbang.attendance.service.SystemService;
import com.demo2do.lighturl.annotation.Action;
import com.xbang.core.page.Result;
import com.xbang.core.struts.support.SearchActionSupport;

/**
 * @author dev.zhang
 * 
 */
public class Index extends SearchActionSupport {

	private static final long serialVersionUID = 4604709900883572987L;

	@Autowired
	private SystemService systemService;

	private List<TimeRole> timeroles = new ArrayList<TimeRole>();


	public List<TimeRole> getTimeroles() {
		return timeroles;
	}


	public void setTimeroles(List<TimeRole> timeroles) {
		this.timeroles = timeroles;
	}



	@Action("/purchase/timerole/list")
	public String list() throws Exception {

		String hqlSentence = "FROM TimeRole TimeRole WHERE 1 = 1";

		Result result = systemService.searchByPage(hqlSentence, searchComponent, page);

		timeroles = result.getItems();
		page = result.getPage();
		return "index";
	}


	public void setSystemService(SystemService systemService) {
		this.systemService = systemService;
	}


	@Override
	public void resetCustomerSearchCriteria() {
		// TODO Auto-generated method stub
	}
	}
